package com.atguigu.light;

import com.atguigu.Command;

/**
 * @author li.chunlong lcl253-137@alibaba-inc.com
 * @desc ConcreteCommand角色
 * @date 2021-08-20
 */
public class LightOffCommand implements Command {

    private LightReceiver lightReceiver;

    public LightOffCommand(LightReceiver receiver) {
        this.lightReceiver = receiver;
    }

    @Override
    public void execute() {
        lightReceiver.off();
    }

    @Override
    public void undo() {
        lightReceiver.on();
    }
}
